package com.pwc.ackAdvance;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author fantuancyh
 * @data 2021/8/22
 */
@Slf4j
@Component
public class ConfirmConsumer {
    private static final String QUEUE_NAME = "confirm.queue";
    @RabbitListener(queues = QUEUE_NAME)
    public void getMsg(Message testMessage){
        log.info("{}消费者接受消息，内容{}",new Date(),new String(testMessage.getBody()));
        System.out.println(testMessage);
    }
}
